home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
filutil
/
mdf130.zip
/
MDFL130.ZIP
/
CSAMP.ZIP
/
MPATCH.H
next >
Wrap
C/C++ Source or Header
|
1995-01-12
|
2KB
|
80 lines
#ifndef _MPATCH_H_
#define _MPATCH_H_
/* MDF - Algorithm version: 1.30 */
#ifndef CMTSIZE
#define CMTSIZE 2048
#endif
#ifdef __cplusplus
// C++ Mpatch class
class MPatch {
unsigned long UnRegCrc;
char *FileBuffer;
short error;
char Doldfile[256];
char Dnewfile[256];
char Name[256];
char Comment[CMTSIZE];
unsigned long rate;
short Patch(FILE *fold,FILE *fnew,FILE *fdiff);
public:
MPatch();
void SetRate(short r=10);
short MDFPatch(char *diffile, char *oldfile, char *newfile);
char *LastError();
virtual void Show_start();
virtual void Show();
virtual void Show_end();
};
#endif
// *.MDF header info structure
struct MDF_header_info
{
char alg_ver[4]; // Algorithm version
char oldfilename[256]; // Old file name stored in MDF
char newfilename[256]; // New file name stored in MDF
char registeredto[256]; // Registered to
char comment[CMTSIZE]; // Comment stored in MDF
unsigned long oldfilecrc; // Old file CRC-32
short chunk_len; // Chunk lenght
unsigned long n_chunks; // Number of chunks
};
#ifdef __cplusplus
extern "C" {
#endif
// C/C++ header read function
short readMDFhead(char *fn,struct MDF_header_info *hi); // Reads header from fn file
// Returns:
// 0 = File not found
// 1 = OK
// -1 = Not a MDIFF file
// -2 = Wrong MDF version
// C functions
short MDFPatch(char *mfl,char *ofl,char *nfl);
char *MDFError(short e);
#ifdef __cplusplus
}
#endif
#ifdef __DLL__
// Windows DLL functions
extern int far pascal _export MPATCH(char *fmdf,char *fold,char *fnew);
extern int far pascal _export MDFHEAD(char *fn,MDF_header_info *hi);
#endif
#endif